Skip to content

Demo tooling: bare-pod Foodbolt peers, demo CLI, laptop collector - #85

Merged
AlexanderWangY merged 5 commits into
mainfrom
infra/cloud-integration
Nov 19, 2026
Merged

AlexanderWangY merged 5 commits into
mainfrom
infra/cloud-integration

Conversation

@AlexanderWangY

Copy link
Copy Markdown
Collaborator

What

Tooling to run the Foodbolt-on-Spectral demo on the K3s cluster, with the collector and visz on the presenter's laptop.

  • scripts/foodbolt-pods starts peers as bare Pods (restartPolicy: Never, no controller). Every Pod is a Foodbolt service plus a spctrld sidecar. Nothing restarts or reschedules on its own: a killed peer stays dead and every join is a manual command.
    • Every peer seeds. The headless Service spctrld-peers-<run> selects all peers in the run. spctrld re-resolves it on every seed pull, so any live peer admits new ones and killing a given peer never blocks joins. A sidecar-only seed Pod starts only when a run has no live peers. If every peer is dead but the old seed still exists, the script refuses rather than start an isolated second network.
    • Starting a gateway also creates a gateway-<run> NodePort, reachable over Tailscale.
    • SPECTRAL_COLLECTOR_URL is required; an empty string disables reports.
    • The sidecar's API port is renamed spctrld-api. Both containers used to name a port http, which would have routed the gateway Service to spctrld instead of the gateway.
    • OTEL_SERVICE_NAME=spctrld is set again.
  • scripts/demo (+ demo.md) wraps it for presenting: status/watch/machines/graph/logs, up/up-random/up-all, kill/crash (graceful vs no Leave), kill-random/crash-random, kill-app/kill-spctrld (stop one container through crictl over SSH), crash-machine, order and down. Pod names accept a unique prefix. Defaults are run demo-1, sha-297689b and http://<your Tailscale IP>:9400; each can be overridden by env.
  • infra/workstation/compose.yaml runs the collector (ghcr.io/cap-theorem/spectral-collector, --stale-after=1m) on :9400 and visz on :9500 on the laptop. The cluster nodes are small and high-latency, so analysis and rendering stay local and the sidecars report over Tailscale.
  • Reverts 8e0347c (seed Deployment + 19 workers in overlays/cloud). That self-healing model conflicts with the bare-pod demo, and the script refused to run alongside it. overlays/cloud is back to the plain spctrld Deployment.

Testing

Run live on the 3-node cluster with sha-297689b and foodbolt sha-5be11a9:

  • Peers joined through the run Service, and the collector showed one component throughout.
  • Orders routed across all five services on all three machines.
  • Every kill mode left its pod or container dead (dead(0) / dead(137)).
  • Killing every payments peer made orders fail with "no instance of payments". up-all restored them.
  • crash-machine kept the overlay connected.
  • The collector showed service and instance labels for each peer.

For reviewers

  • visz image. infra/workstation builds visz from a sibling checkout (../../../visz, or VISZ_DIR). It needs the visz Dockerfile, which isn't in that repo yet.
  • Single-container kills need SSH. kill-app and kill-spctrld need SSH as ubuntu with passwordless sudo on the nodes; the Ansible setup provides it.
  • Scale down the old Deployment first. The cluster's spectral/spctrld Deployment has to be at 0 replicas before foodbolt-pods will run, and reapplying overlays/cloud during a demo brings it back.

h1divp and others added 5 commits November 19, 2026 15:08
This reverts commit 8e0347c. The demo runs
bare pods from scripts/foodbolt-pods, where nothing is restarted, so the
self-healing seed Deployment no longer fits.
foodbolt-pods: the peers Service selects every peer in the run, so joins no
longer depend on one seed pod; the seed starts only when a run has no live
peers. Adds a gateway NodePort, requires SPECTRAL_COLLECTOR_URL, restores
OTEL_SERVICE_NAME, and renames the sidecar port so it no longer clashes with
the service's http port.

scripts/demo wraps it: status, watch, up, up-random, kill, crash, random
kills, single-container stops over crictl, crash-machine, orders and down.
The collector (from GHCR) and visz run on the presenting laptop; cluster
sidecars report to it over Tailscale.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@AlexanderWangY
AlexanderWangY merged commit a81a5da into main Nov 19, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants